// $ANTLR 3.4 /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g 2013-11-10 19:47:20

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.runtime.debug.*;
import java.io.IOException;
import org.antlr.runtime.tree.*;


@SuppressWarnings({"all", "warnings", "unchecked"})
public class Aufgabe2_ASTParser extends DebugParser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "EQUAL", "OPERATOR", "RAETSEL", "WHITESPACE", "Z_BLOCK"
    };

    public static final int EOF=-1;
    public static final int EQUAL=4;
    public static final int OPERATOR=5;
    public static final int RAETSEL=6;
    public static final int WHITESPACE=7;
    public static final int Z_BLOCK=8;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


public static final String[] ruleNames = new String[] {
    "invalidRule", "operator", "raetsel", "equal", "zblock"
};

public static final boolean[] decisionCanBacktrack = new boolean[] {
    false, // invalid decision
    false
};

 
    public int ruleLevel = 0;
    public int getRuleLevel() { return ruleLevel; }
    public void incRuleLevel() { ruleLevel++; }
    public void decRuleLevel() { ruleLevel--; }
    public Aufgabe2_ASTParser(TokenStream input) {
        this(input, DebugEventSocketProxy.DEFAULT_DEBUGGER_PORT, new RecognizerSharedState());
    }
    public Aufgabe2_ASTParser(TokenStream input, int port, RecognizerSharedState state) {
        super(input, state);
        DebugEventSocketProxy proxy =
            new DebugEventSocketProxy(this,port,adaptor);
        setDebugListener(proxy);
        setTokenStream(new DebugTokenStream(input,proxy));
        try {
            proxy.handshake();
        }
        catch (IOException ioe) {
            reportError(ioe);
        }
        TreeAdaptor adap = new CommonTreeAdaptor();
        setTreeAdaptor(adap);
        proxy.setTreeAdaptor(adap);
    }

public Aufgabe2_ASTParser(TokenStream input, DebugEventListener dbg) {
    super(input, dbg);
     
    TreeAdaptor adap = new CommonTreeAdaptor();
    setTreeAdaptor(adap);


}

protected boolean evalPredicate(boolean result, String predicate) {
    dbg.semanticPredicate(result, predicate);
    return result;
}

protected DebugTreeAdaptor adaptor;
public void setTreeAdaptor(TreeAdaptor adaptor) {
    this.adaptor = new DebugTreeAdaptor(dbg,adaptor);


}
public TreeAdaptor getTreeAdaptor() {
    return adaptor;
}

    public String[] getTokenNames() { return Aufgabe2_ASTParser.tokenNames; }
    public String getGrammarFileName() { return "/Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g"; }


    public static class raetsel_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "raetsel"
    // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:13:1: raetsel : (a1= zblock o1= operator a2= zblock e1= equal a3= zblock o2= operator o3= operator o4= operator a4= zblock o5= operator a5= zblock e2= equal a6= zblock e3= equal e4= equal e5= equal a7= zblock o6= operator a8= zblock e6= equal a9= zblock ) -> ^( RAETSEL ^( $e1 ^( $o1 $a1 $a2) $a3) ^( $e3 ^( $o2 $a1 $a4) $a7) ^( $e2 ^( $o3 $a2 $a5) $a8) ^( $e4 ^( $o4 $a3 $a6) $a9) ^( $e5 ^( $o5 $a4 $a5) $a6) ^( $e6 ^( $o6 $a7 $a8) $a9) ) ;
    public final Aufgabe2_ASTParser.raetsel_return raetsel() throws RecognitionException {
        Aufgabe2_ASTParser.raetsel_return retval = new Aufgabe2_ASTParser.raetsel_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Aufgabe2_ASTParser.zblock_return a1 =null;

        Aufgabe2_ASTParser.operator_return o1 =null;

        Aufgabe2_ASTParser.zblock_return a2 =null;

        Aufgabe2_ASTParser.equal_return e1 =null;

        Aufgabe2_ASTParser.zblock_return a3 =null;

        Aufgabe2_ASTParser.operator_return o2 =null;

        Aufgabe2_ASTParser.operator_return o3 =null;

        Aufgabe2_ASTParser.operator_return o4 =null;

        Aufgabe2_ASTParser.zblock_return a4 =null;

        Aufgabe2_ASTParser.operator_return o5 =null;

        Aufgabe2_ASTParser.zblock_return a5 =null;

        Aufgabe2_ASTParser.equal_return e2 =null;

        Aufgabe2_ASTParser.zblock_return a6 =null;

        Aufgabe2_ASTParser.equal_return e3 =null;

        Aufgabe2_ASTParser.equal_return e4 =null;

        Aufgabe2_ASTParser.equal_return e5 =null;

        Aufgabe2_ASTParser.zblock_return a7 =null;

        Aufgabe2_ASTParser.operator_return o6 =null;

        Aufgabe2_ASTParser.zblock_return a8 =null;

        Aufgabe2_ASTParser.equal_return e6 =null;

        Aufgabe2_ASTParser.zblock_return a9 =null;


        RewriteRuleSubtreeStream stream_zblock=new RewriteRuleSubtreeStream(adaptor,"rule zblock");
        RewriteRuleSubtreeStream stream_equal=new RewriteRuleSubtreeStream(adaptor,"rule equal");
        RewriteRuleSubtreeStream stream_operator=new RewriteRuleSubtreeStream(adaptor,"rule operator");
        try { dbg.enterRule(getGrammarFileName(), "raetsel");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(13, 0);

        try {
            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:13:9: ( (a1= zblock o1= operator a2= zblock e1= equal a3= zblock o2= operator o3= operator o4= operator a4= zblock o5= operator a5= zblock e2= equal a6= zblock e3= equal e4= equal e5= equal a7= zblock o6= operator a8= zblock e6= equal a9= zblock ) -> ^( RAETSEL ^( $e1 ^( $o1 $a1 $a2) $a3) ^( $e3 ^( $o2 $a1 $a4) $a7) ^( $e2 ^( $o3 $a2 $a5) $a8) ^( $e4 ^( $o4 $a3 $a6) $a9) ^( $e5 ^( $o5 $a4 $a5) $a6) ^( $e6 ^( $o6 $a7 $a8) $a9) ) )
            dbg.enterAlt(1);

            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:13:11: (a1= zblock o1= operator a2= zblock e1= equal a3= zblock o2= operator o3= operator o4= operator a4= zblock o5= operator a5= zblock e2= equal a6= zblock e3= equal e4= equal e5= equal a7= zblock o6= operator a8= zblock e6= equal a9= zblock )
            {
            dbg.location(13,11);
            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:13:11: (a1= zblock o1= operator a2= zblock e1= equal a3= zblock o2= operator o3= operator o4= operator a4= zblock o5= operator a5= zblock e2= equal a6= zblock e3= equal e4= equal e5= equal a7= zblock o6= operator a8= zblock e6= equal a9= zblock )
            dbg.enterAlt(1);

            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:13:13: a1= zblock o1= operator a2= zblock e1= equal a3= zblock o2= operator o3= operator o4= operator a4= zblock o5= operator a5= zblock e2= equal a6= zblock e3= equal e4= equal e5= equal a7= zblock o6= operator a8= zblock e6= equal a9= zblock
            {
            dbg.location(13,15);
            pushFollow(FOLLOW_zblock_in_raetsel41);
            a1=zblock();

            state._fsp--;

            stream_zblock.add(a1.getTree());
            dbg.location(13,25);
            pushFollow(FOLLOW_operator_in_raetsel45);
            o1=operator();

            state._fsp--;

            stream_operator.add(o1.getTree());
            dbg.location(13,37);
            pushFollow(FOLLOW_zblock_in_raetsel49);
            a2=zblock();

            state._fsp--;

            stream_zblock.add(a2.getTree());
            dbg.location(13,47);
            pushFollow(FOLLOW_equal_in_raetsel53);
            e1=equal();

            state._fsp--;

            stream_equal.add(e1.getTree());
            dbg.location(13,56);
            pushFollow(FOLLOW_zblock_in_raetsel57);
            a3=zblock();

            state._fsp--;

            stream_zblock.add(a3.getTree());
            dbg.location(14,8);
            pushFollow(FOLLOW_operator_in_raetsel66);
            o2=operator();

            state._fsp--;

            stream_operator.add(o2.getTree());
            dbg.location(14,20);
            pushFollow(FOLLOW_operator_in_raetsel70);
            o3=operator();

            state._fsp--;

            stream_operator.add(o3.getTree());
            dbg.location(14,32);
            pushFollow(FOLLOW_operator_in_raetsel74);
            o4=operator();

            state._fsp--;

            stream_operator.add(o4.getTree());
            dbg.location(15,8);
            pushFollow(FOLLOW_zblock_in_raetsel83);
            a4=zblock();

            state._fsp--;

            stream_zblock.add(a4.getTree());
            dbg.location(15,18);
            pushFollow(FOLLOW_operator_in_raetsel87);
            o5=operator();

            state._fsp--;

            stream_operator.add(o5.getTree());
            dbg.location(15,30);
            pushFollow(FOLLOW_zblock_in_raetsel91);
            a5=zblock();

            state._fsp--;

            stream_zblock.add(a5.getTree());
            dbg.location(15,40);
            pushFollow(FOLLOW_equal_in_raetsel95);
            e2=equal();

            state._fsp--;

            stream_equal.add(e2.getTree());
            dbg.location(15,49);
            pushFollow(FOLLOW_zblock_in_raetsel99);
            a6=zblock();

            state._fsp--;

            stream_zblock.add(a6.getTree());
            dbg.location(16,8);
            pushFollow(FOLLOW_equal_in_raetsel108);
            e3=equal();

            state._fsp--;

            stream_equal.add(e3.getTree());
            dbg.location(16,17);
            pushFollow(FOLLOW_equal_in_raetsel112);
            e4=equal();

            state._fsp--;

            stream_equal.add(e4.getTree());
            dbg.location(16,26);
            pushFollow(FOLLOW_equal_in_raetsel116);
            e5=equal();

            state._fsp--;

            stream_equal.add(e5.getTree());
            dbg.location(17,8);
            pushFollow(FOLLOW_zblock_in_raetsel125);
            a7=zblock();

            state._fsp--;

            stream_zblock.add(a7.getTree());
            dbg.location(17,18);
            pushFollow(FOLLOW_operator_in_raetsel129);
            o6=operator();

            state._fsp--;

            stream_operator.add(o6.getTree());
            dbg.location(17,30);
            pushFollow(FOLLOW_zblock_in_raetsel133);
            a8=zblock();

            state._fsp--;

            stream_zblock.add(a8.getTree());
            dbg.location(17,40);
            pushFollow(FOLLOW_equal_in_raetsel137);
            e6=equal();

            state._fsp--;

            stream_equal.add(e6.getTree());
            dbg.location(17,49);
            pushFollow(FOLLOW_zblock_in_raetsel141);
            a9=zblock();

            state._fsp--;

            stream_zblock.add(a9.getTree());

            }


            // AST REWRITE
            // elements: a9, a1, a3, o4, a4, a6, a5, e3, e4, e2, e1, o5, a2, o1, a3, a1, o2, a9, a5, e5, e6, a8, a2, o6, a8, a7, o3, a4, a7, a6
            // token labels: 
            // rule labels: retval, o2, o1, o4, o3, o6, o5, e6, e5, a9, e3, e4, e1, e2, a1, a2, a3, a4, a5, a6, a7, a8
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
            RewriteRuleSubtreeStream stream_o2=new RewriteRuleSubtreeStream(adaptor,"rule o2",o2!=null?o2.tree:null);
            RewriteRuleSubtreeStream stream_o1=new RewriteRuleSubtreeStream(adaptor,"rule o1",o1!=null?o1.tree:null);
            RewriteRuleSubtreeStream stream_o4=new RewriteRuleSubtreeStream(adaptor,"rule o4",o4!=null?o4.tree:null);
            RewriteRuleSubtreeStream stream_o3=new RewriteRuleSubtreeStream(adaptor,"rule o3",o3!=null?o3.tree:null);
            RewriteRuleSubtreeStream stream_o6=new RewriteRuleSubtreeStream(adaptor,"rule o6",o6!=null?o6.tree:null);
            RewriteRuleSubtreeStream stream_o5=new RewriteRuleSubtreeStream(adaptor,"rule o5",o5!=null?o5.tree:null);
            RewriteRuleSubtreeStream stream_e6=new RewriteRuleSubtreeStream(adaptor,"rule e6",e6!=null?e6.tree:null);
            RewriteRuleSubtreeStream stream_e5=new RewriteRuleSubtreeStream(adaptor,"rule e5",e5!=null?e5.tree:null);
            RewriteRuleSubtreeStream stream_a9=new RewriteRuleSubtreeStream(adaptor,"rule a9",a9!=null?a9.tree:null);
            RewriteRuleSubtreeStream stream_e3=new RewriteRuleSubtreeStream(adaptor,"rule e3",e3!=null?e3.tree:null);
            RewriteRuleSubtreeStream stream_e4=new RewriteRuleSubtreeStream(adaptor,"rule e4",e4!=null?e4.tree:null);
            RewriteRuleSubtreeStream stream_e1=new RewriteRuleSubtreeStream(adaptor,"rule e1",e1!=null?e1.tree:null);
            RewriteRuleSubtreeStream stream_e2=new RewriteRuleSubtreeStream(adaptor,"rule e2",e2!=null?e2.tree:null);
            RewriteRuleSubtreeStream stream_a1=new RewriteRuleSubtreeStream(adaptor,"rule a1",a1!=null?a1.tree:null);
            RewriteRuleSubtreeStream stream_a2=new RewriteRuleSubtreeStream(adaptor,"rule a2",a2!=null?a2.tree:null);
            RewriteRuleSubtreeStream stream_a3=new RewriteRuleSubtreeStream(adaptor,"rule a3",a3!=null?a3.tree:null);
            RewriteRuleSubtreeStream stream_a4=new RewriteRuleSubtreeStream(adaptor,"rule a4",a4!=null?a4.tree:null);
            RewriteRuleSubtreeStream stream_a5=new RewriteRuleSubtreeStream(adaptor,"rule a5",a5!=null?a5.tree:null);
            RewriteRuleSubtreeStream stream_a6=new RewriteRuleSubtreeStream(adaptor,"rule a6",a6!=null?a6.tree:null);
            RewriteRuleSubtreeStream stream_a7=new RewriteRuleSubtreeStream(adaptor,"rule a7",a7!=null?a7.tree:null);
            RewriteRuleSubtreeStream stream_a8=new RewriteRuleSubtreeStream(adaptor,"rule a8",a8!=null?a8.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 18:6: -> ^( RAETSEL ^( $e1 ^( $o1 $a1 $a2) $a3) ^( $e3 ^( $o2 $a1 $a4) $a7) ^( $e2 ^( $o3 $a2 $a5) $a8) ^( $e4 ^( $o4 $a3 $a6) $a9) ^( $e5 ^( $o5 $a4 $a5) $a6) ^( $e6 ^( $o6 $a7 $a8) $a9) )
            {
                dbg.location(18,9);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:9: ^( RAETSEL ^( $e1 ^( $o1 $a1 $a2) $a3) ^( $e3 ^( $o2 $a1 $a4) $a7) ^( $e2 ^( $o3 $a2 $a5) $a8) ^( $e4 ^( $o4 $a3 $a6) $a9) ^( $e5 ^( $o5 $a4 $a5) $a6) ^( $e6 ^( $o6 $a7 $a8) $a9) )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                dbg.location(18,11);
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(RAETSEL, "RAETSEL")
                , root_1);

                dbg.location(18,19);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:19: ^( $e1 ^( $o1 $a1 $a2) $a3)
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(18,22);
                root_2 = (CommonTree)adaptor.becomeRoot(stream_e1.nextNode(), root_2);

                dbg.location(18,25);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:25: ^( $o1 $a1 $a2)
                {
                CommonTree root_3 = (CommonTree)adaptor.nil();
                dbg.location(18,28);
                root_3 = (CommonTree)adaptor.becomeRoot(stream_o1.nextNode(), root_3);

                dbg.location(18,32);
                adaptor.addChild(root_3, stream_a1.nextTree());
                dbg.location(18,36);
                adaptor.addChild(root_3, stream_a2.nextTree());

                adaptor.addChild(root_2, root_3);
                }
                dbg.location(18,41);
                adaptor.addChild(root_2, stream_a3.nextTree());

                adaptor.addChild(root_1, root_2);
                }
                dbg.location(18,44);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:44: ^( $e3 ^( $o2 $a1 $a4) $a7)
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(18,47);
                root_2 = (CommonTree)adaptor.becomeRoot(stream_e3.nextNode(), root_2);

                dbg.location(18,50);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:50: ^( $o2 $a1 $a4)
                {
                CommonTree root_3 = (CommonTree)adaptor.nil();
                dbg.location(18,53);
                root_3 = (CommonTree)adaptor.becomeRoot(stream_o2.nextNode(), root_3);

                dbg.location(18,57);
                adaptor.addChild(root_3, stream_a1.nextTree());
                dbg.location(18,61);
                adaptor.addChild(root_3, stream_a4.nextTree());

                adaptor.addChild(root_2, root_3);
                }
                dbg.location(18,66);
                adaptor.addChild(root_2, stream_a7.nextTree());

                adaptor.addChild(root_1, root_2);
                }
                dbg.location(18,69);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:69: ^( $e2 ^( $o3 $a2 $a5) $a8)
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(18,72);
                root_2 = (CommonTree)adaptor.becomeRoot(stream_e2.nextNode(), root_2);

                dbg.location(18,75);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:75: ^( $o3 $a2 $a5)
                {
                CommonTree root_3 = (CommonTree)adaptor.nil();
                dbg.location(18,78);
                root_3 = (CommonTree)adaptor.becomeRoot(stream_o3.nextNode(), root_3);

                dbg.location(18,82);
                adaptor.addChild(root_3, stream_a2.nextTree());
                dbg.location(18,86);
                adaptor.addChild(root_3, stream_a5.nextTree());

                adaptor.addChild(root_2, root_3);
                }
                dbg.location(18,91);
                adaptor.addChild(root_2, stream_a8.nextTree());

                adaptor.addChild(root_1, root_2);
                }
                dbg.location(18,94);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:94: ^( $e4 ^( $o4 $a3 $a6) $a9)
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(18,97);
                root_2 = (CommonTree)adaptor.becomeRoot(stream_e4.nextNode(), root_2);

                dbg.location(18,100);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:100: ^( $o4 $a3 $a6)
                {
                CommonTree root_3 = (CommonTree)adaptor.nil();
                dbg.location(18,103);
                root_3 = (CommonTree)adaptor.becomeRoot(stream_o4.nextNode(), root_3);

                dbg.location(18,107);
                adaptor.addChild(root_3, stream_a3.nextTree());
                dbg.location(18,111);
                adaptor.addChild(root_3, stream_a6.nextTree());

                adaptor.addChild(root_2, root_3);
                }
                dbg.location(18,116);
                adaptor.addChild(root_2, stream_a9.nextTree());

                adaptor.addChild(root_1, root_2);
                }
                dbg.location(18,119);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:119: ^( $e5 ^( $o5 $a4 $a5) $a6)
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(18,122);
                root_2 = (CommonTree)adaptor.becomeRoot(stream_e5.nextNode(), root_2);

                dbg.location(18,125);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:125: ^( $o5 $a4 $a5)
                {
                CommonTree root_3 = (CommonTree)adaptor.nil();
                dbg.location(18,128);
                root_3 = (CommonTree)adaptor.becomeRoot(stream_o5.nextNode(), root_3);

                dbg.location(18,132);
                adaptor.addChild(root_3, stream_a4.nextTree());
                dbg.location(18,136);
                adaptor.addChild(root_3, stream_a5.nextTree());

                adaptor.addChild(root_2, root_3);
                }
                dbg.location(18,141);
                adaptor.addChild(root_2, stream_a6.nextTree());

                adaptor.addChild(root_1, root_2);
                }
                dbg.location(18,144);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:144: ^( $e6 ^( $o6 $a7 $a8) $a9)
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                dbg.location(18,147);
                root_2 = (CommonTree)adaptor.becomeRoot(stream_e6.nextNode(), root_2);

                dbg.location(18,150);
                // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:18:150: ^( $o6 $a7 $a8)
                {
                CommonTree root_3 = (CommonTree)adaptor.nil();
                dbg.location(18,153);
                root_3 = (CommonTree)adaptor.becomeRoot(stream_o6.nextNode(), root_3);

                dbg.location(18,157);
                adaptor.addChild(root_3, stream_a7.nextTree());
                dbg.location(18,161);
                adaptor.addChild(root_3, stream_a8.nextTree());

                adaptor.addChild(root_2, root_3);
                }
                dbg.location(18,166);
                adaptor.addChild(root_2, stream_a9.nextTree());

                adaptor.addChild(root_1, root_2);
                }

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(18, 169);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "raetsel");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "raetsel"


    public static class zblock_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "zblock"
    // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:19:1: zblock : ( Z_BLOCK )* ;
    public final Aufgabe2_ASTParser.zblock_return zblock() throws RecognitionException {
        Aufgabe2_ASTParser.zblock_return retval = new Aufgabe2_ASTParser.zblock_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token Z_BLOCK1=null;

        CommonTree Z_BLOCK1_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "zblock");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(19, 0);

        try {
            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:19:9: ( ( Z_BLOCK )* )
            dbg.enterAlt(1);

            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:19:11: ( Z_BLOCK )*
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(19,11);
            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:19:11: ( Z_BLOCK )*
            try { dbg.enterSubRule(1);

            loop1:
            do {
                int alt1=2;
                try { dbg.enterDecision(1, decisionCanBacktrack[1]);

                int LA1_0 = input.LA(1);

                if ( (LA1_0==Z_BLOCK) ) {
                    alt1=1;
                }


                } finally {dbg.exitDecision(1);}

                switch (alt1) {
            	case 1 :
            	    dbg.enterAlt(1);

            	    // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:19:12: Z_BLOCK
            	    {
            	    dbg.location(19,12);
            	    Z_BLOCK1=(Token)match(input,Z_BLOCK,FOLLOW_Z_BLOCK_in_zblock271); 
            	    Z_BLOCK1_tree = 
            	    (CommonTree)adaptor.create(Z_BLOCK1)
            	    ;
            	    adaptor.addChild(root_0, Z_BLOCK1_tree);


            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);
            } finally {dbg.exitSubRule(1);}


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(19, 20);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "zblock");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "zblock"


    public static class operator_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "operator"
    // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:21:1: operator : OPERATOR ;
    public final Aufgabe2_ASTParser.operator_return operator() throws RecognitionException {
        Aufgabe2_ASTParser.operator_return retval = new Aufgabe2_ASTParser.operator_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token OPERATOR2=null;

        CommonTree OPERATOR2_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "operator");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(21, 0);

        try {
            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:21:10: ( OPERATOR )
            dbg.enterAlt(1);

            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:21:12: OPERATOR
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(21,12);
            OPERATOR2=(Token)match(input,OPERATOR,FOLLOW_OPERATOR_in_operator282); 
            OPERATOR2_tree = 
            (CommonTree)adaptor.create(OPERATOR2)
            ;
            adaptor.addChild(root_0, OPERATOR2_tree);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(21, 19);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "operator");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "operator"


    public static class equal_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "equal"
    // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:23:1: equal : EQUAL ;
    public final Aufgabe2_ASTParser.equal_return equal() throws RecognitionException {
        Aufgabe2_ASTParser.equal_return retval = new Aufgabe2_ASTParser.equal_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token EQUAL3=null;

        CommonTree EQUAL3_tree=null;

        try { dbg.enterRule(getGrammarFileName(), "equal");
        if ( getRuleLevel()==0 ) {dbg.commence();}
        incRuleLevel();
        dbg.location(23, 0);

        try {
            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:23:9: ( EQUAL )
            dbg.enterAlt(1);

            // /Users/iamapo/Desktop/CI Praktikum 2/Aufgabe2_AST.g:23:11: EQUAL
            {
            root_0 = (CommonTree)adaptor.nil();


            dbg.location(23,11);
            EQUAL3=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_equal292); 
            EQUAL3_tree = 
            (CommonTree)adaptor.create(EQUAL3)
            ;
            adaptor.addChild(root_0, EQUAL3_tree);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        dbg.location(23, 15);

        }
        finally {
            dbg.exitRule(getGrammarFileName(), "equal");
            decRuleLevel();
            if ( getRuleLevel()==0 ) {dbg.terminate();}
        }

        return retval;
    }
    // $ANTLR end "equal"

    // Delegated rules


 

    public static final BitSet FOLLOW_zblock_in_raetsel41 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_operator_in_raetsel45 = new BitSet(new long[]{0x0000000000000110L});
    public static final BitSet FOLLOW_zblock_in_raetsel49 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_equal_in_raetsel53 = new BitSet(new long[]{0x0000000000000120L});
    public static final BitSet FOLLOW_zblock_in_raetsel57 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_operator_in_raetsel66 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_operator_in_raetsel70 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_operator_in_raetsel74 = new BitSet(new long[]{0x0000000000000120L});
    public static final BitSet FOLLOW_zblock_in_raetsel83 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_operator_in_raetsel87 = new BitSet(new long[]{0x0000000000000110L});
    public static final BitSet FOLLOW_zblock_in_raetsel91 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_equal_in_raetsel95 = new BitSet(new long[]{0x0000000000000110L});
    public static final BitSet FOLLOW_zblock_in_raetsel99 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_equal_in_raetsel108 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_equal_in_raetsel112 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_equal_in_raetsel116 = new BitSet(new long[]{0x0000000000000120L});
    public static final BitSet FOLLOW_zblock_in_raetsel125 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_operator_in_raetsel129 = new BitSet(new long[]{0x0000000000000110L});
    public static final BitSet FOLLOW_zblock_in_raetsel133 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_equal_in_raetsel137 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_zblock_in_raetsel141 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Z_BLOCK_in_zblock271 = new BitSet(new long[]{0x0000000000000102L});
    public static final BitSet FOLLOW_OPERATOR_in_operator282 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_EQUAL_in_equal292 = new BitSet(new long[]{0x0000000000000002L});

}